package com.talent.jiwen;

import android.net.Uri;
import android.view.View;

import com.talent.jiwen.base.BaseActivity;

import butterknife.BindView;
import cn.jzvd.JZVideoPlayer;
import cn.jzvd.JZVideoPlayerStandard;

/**
 * Created by qyqx on 2018/8/9.
 */

public class TestVideoActivity extends BaseActivity{

    @BindView(R.id.videoplayer)
    JZVideoPlayerStandard jzVideoPlayerStandard;


    @Override
    protected int provideContentViewId() {
        return R.layout.activity_test_video;
    }

    @Override
    public String titleName() {
        return "测试视频";
    }

    @Override
    protected void initData() {
        jzVideoPlayerStandard.setUp("http://jzvd.nathen.cn/c6e3dc12a1154626b3476d9bf3bd7266/6b56c5f0dc31428083757a45764763b0-5287d2089db37e62345123a1be272f8b.mp4"
                , JZVideoPlayerStandard.SCREEN_WINDOW_NORMAL, "饺子闭眼睛");
        jzVideoPlayerStandard.thumbImageView.setVisibility(View.VISIBLE);
        jzVideoPlayerStandard.thumbImageView.setImageURI(Uri.parse("http://p.qpic.cn/videoyun/0/2449_43b6f696980311e59ed467f22794e792_1/640"));
//        jzVideoPlayerStandard.thumbImageView.setImage("http://p.qpic.cn/videoyun/0/2449_43b6f696980311e59ed467f22794e792_1/640");
    }

    @Override
    public void onBackPressed() {
        if (JZVideoPlayer.backPress()) {
            return;
        }
        super.onBackPressed();
    }
    @Override
    protected void onPause() {
        super.onPause();
        JZVideoPlayer.releaseAllVideos();
    }
}
